package demo2;

import demo2.*;

public  class Test {
    public static void run(IRunning running) {
        running.run();
    }
    public static void  swim(ISwimming swimming){
        swimming.swim();
    }
     public static void  fly(IFlying flying){
        flying.fly();
    }

    public static void main(String[] args) {
     run(new Dog("小狗"));
     swim(new Fish("小鱼"));
     fly(new Bird("小鸟"));
     Robot robot = new Robot("机器⼈");
     run(robot);
    }

}
